define(['app'], function(app) {
	'use strict';

	//实例化方法
	var factory = function(Http) {
		function get_data_productmanager_sort(result) {
			if(HTTP_ISLOGIC) {
				result = '{"success": true,"msg": "","result": {"custom_cat": [' +
					'{"custom_cat_id": 1,"store_id": 1,"parent_id": 1,"is_leaf": false,"cat_name": "大分类","disabled": false,"p_order": 1,"goods_count": 10,"child_count": 2},' +
					'{"custom_cat_id": 2,"store_id": 2,"parent_id": 1,"is_leaf": true,"cat_name": "中分类","disabled": false,"p_order": 2,"goods_count": 10,"child_count": 1}]},' +
					'"session": "7311da98bd0f18eb15a96bcb263f4153"}';
					return JSON.parse(result);
			}
			else
			return result;
		}
		//返回信息
		return {
			//获取首页数据
			get_list: function(callback) {
				//post请求
				Http.post({
					method:'goods.cat.list.get',
					session:'',
					nPage:1,
					num:8,
					parent_id:1
				}, function(result) {
					//函数回调
					if(callback)
						callback(get_data_productmanager_sort(result).result);
				},function(e){
					
				},function(){
					
				});

			},
		};
	}

	factory.$inject = ['Http'];
	return app.registerService("Productmanager_sort", factory);
});